package edu.sctu.renpingan.imitatesubwaysystem;

import java.util.HashMap;

/**
 * Created by user18 on 2015/5/31.
 */
public class Station {


    public HashMap<String,Integer> subwaystation = new HashMap<String,Integer>();
    public int getconsume(String start,String end){
        HashMap<String,Integer> subwaystation = new HashMap<String,Integer>();
        subwaystation.put("犀浦",1);
        subwaystation.put("茶电子",2);
        subwaystation.put("一品天下",3);
        subwaystation.put("蜀汉路",4);
        subwaystation.put("天府广场",5);
        subwaystation.put("东大路",6);
        subwaystation.put("成渝立交",7);
        subwaystation.put("惠王陵",8);
        subwaystation.put("成都行政学院",9);
        subwaystation.put("书房",10);
        subwaystation.put("龙泉",11);

        int number=0;
        if(subwaystation.get(start)>subwaystation.get(end)){
            number=subwaystation.get(start)-subwaystation.get(end);
        }else {
            number=subwaystation.get(end)-subwaystation.get(start);
        }
        int consume = 0;
        switch (number) {
            case 0:
                consume = 2;
            case 1:
                consume = 2;
            case 2:
                consume = 2;
            case 3:
                consume = 2;
            case 4:
                consume = 4;
            case 5:
                consume = 4;
            case 6:
                consume = 4;
            case 7:
                consume = 5;
            case 8:
                consume = 5;
            case 9:
                consume = 6;
            case 10:
                consume = 6;
            case 11:
                consume = 6;

        }

        return consume;
    }



}
